
// 获取道具仓库数据 {"序列":1}  warehouse


// @ts-ignore
export async function execute(client_id,message_json) {
    let index = message_json["序列"];
    let type_data = ["杂货", "宝石", "兽诀", "高兽诀", "特兽诀", "打造", "装备"];

    if (index !== undefined && index - 1 >= 0 && index - 1 <= 7) {
        let login_characters = G.Characters.get_current_login_characters(client_id);
        index = index - 1;
        let send_data = {
            "类型": index + 1,
            "体力": login_characters["体力"],
            "银子": login_characters["银子"],
            "储备": login_characters["储备"],
            "存银": login_characters["存银"],
            "物品": [],
        }
        let data = login_characters["道具仓库"];
        if (data === undefined) {
            login_characters["道具仓库"] = {};
            for (let index = 0; index < type_data.length; index++) {
                let type = type_data[index];
                let datas = [];
                for (let index = 0; index < 300; index++) {
                    datas.push(null);
                }
                login_characters["道具仓库"][type] = datas;
            }
            login_characters["道具仓库"] = { "杂货": [], "宝石": [], "兽诀": [], "高兽诀": [], "特兽诀": [], "打造": [], "装备": [] };
            ClientUtils.send_client_message(client_id, 3555, send_data);
        } else {
            send_data["物品"] = login_characters["道具仓库"][type_data[index]];
            ClientUtils.send_client_message(client_id, 3555, send_data);
        }
    }
}
